/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package com.lineage.server.model.item;

/**
 * Class <code>L1Item</code> 道具.
 * 
 * @author jrwz
 * @version 2012-6-20下午05:54:44
 * @see com.lineage.server.model.item
 * @since JDK1.7
 */
public final class L1Item {

    /** 名称. */
    private final String name;
    /** 参数. */
    private final String[] args;
    /** 关闭. */
    public static final L1Item ITEM_CLOSE = new L1Item("");

    /**
     * 道具.
     * 
     * @param s
     *            - 名称
     */
    public L1Item(final String s) {
        this(s, new String[] {});
    }

    /**
     * 道具.
     * 
     * @param s
     *            - 名称
     * @param arg
     *            - 参数
     */
    public L1Item(final String s, final String... arg) {
        if ((s == null) || (arg == null)) {
            throw new NullPointerException();
        }
        this.name = s;
        this.args = arg;
    }

    /**
     * 取得参数.
     * 
     * @return 参数
     */
    public String[] getArgs() {
        return this.args;
    }

    /**
     * 取得名称.
     * 
     * @return 名称
     */
    public String getName() {
        return this.name;
    }
}
